package com.example.lottery_system.dao.Mapper;

import com.example.lottery_system.dao.DataObject.PrizeDO;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PrizeMapper {


    List<Long>  selectIdByPrizeId(@Param("items") List<Long> prizeIdList);

//    @Insert("insert into prize(name,`price`,description, `image_url`) values " +
//            "(#{name},#{price},#{description},#{imageUrl})")
//    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    long insertPrize(PrizeDO prizeDo);

//    @Select("select count(1) from `prize` ")
    int selectCount();

//    @Select("select id , name, description, price, image_url from `prize` order by id desc limit #{offset},#{pageSize} " )
    List<PrizeDO> selectPrizeList(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize);

    List<PrizeDO> selectByPrizeId(@Param("items") List<Long> prizeIds);

    PrizeDO selectById(@Param("id") Long prizeId);

    Integer deletePrize(@Param("prizeId") Long prizeId);
}
